#include <iostream>
#include <vector>

#include "TestCaseGenerator.h"

using namespace std;

void Swap(int &a, int &b)
{
	int tmp = a;
	a = b;
	b = tmp;
}

void InsectionSort(vector<int> &array)
{
	int length = array.size();
	if (length < 2)
		return;

	for (int i = 1; i < length; i++)
	{
		int index = i;
		while (index - 1 >= 0 && array[index - 1] > array[index])
		{
			Swap(array[index], array[index - 1]);
			index--;
		}
	}
}


int main()
{
	shared_ptr<TestCaseGenerator> tcgPtr;

	vector<int> testCaseArray = tcgPtr->GenerateTestCase(5, 0, 10);
	InsectionSort(testCaseArray);

	vector<int> testCaseArray1 = tcgPtr->GenerateTestCase();
	InsectionSort(testCaseArray1);	

	return 0;
}